home *** CD-ROM | disk | FTP | other *** search
/ mac CD 73 / Image.iso / index / • Newton / Fun / FireWorks 1.1 ƒ / source / fixedSin.def < prev    next >
Encoding:
Text File  |  1998-12-26  |  2.4 KB  |  75 lines  |  [TEXT/NTP1]

  1. /*====================================================================
  2.     fixedSin.def    ©1998 rryu.
  3.  
  4.     fixed point 
  5.  
  6.   ====================================================================*/
  7.  
  8. constant kPtPos := 10;    //point bit position
  9.  
  10. /*----------------------------------------------------------------------
  11.     sin table
  12. */
  13. DefConst('kSinTable,
  14. [
  15.     0,17,35,53,71,89,107,124,142,160,
  16.     177,195,212,230,247,265,282,299,316,333,
  17.     350,366,383,400,416,432,448,464,480,496,
  18.     511,527,542,557,572,587,601,616,630,644,
  19.     658,671,685,698,711,724,736,748,760,772,
  20.     784,795,806,817,828,838,848,858,868,877,
  21.     886,895,904,912,920,928,935,942,949,955,
  22.     962,968,973,979,984,989,993,997,1001,1005,
  23.     1008,1011,1014,1016,1018,1020,1021,1022,1023,1023,
  24.     1024,1023,1023,1022,1021,1020,1018,1016,1014,1011,
  25.     1008,1005,1001,997,993,989,984,979,973,968,
  26.     962,955,949,942,935,928,920,912,904,895,
  27.     886,877,868,858,848,838,828,817,806,795,
  28.     784,772,760,748,736,724,711,698,685,671,
  29.     658,644,630,616,601,587,572,557,542,527,
  30.     512,496,480,464,448,432,416,400,383,366,
  31.     350,333,316,299,282,265,247,230,212,195,
  32.     177,160,142,124,107,89,71,53,35,17,
  33.     0,-17,-35,-53,-71,-89,-107,-124,-142,-160,
  34.     -177,-195,-212,-230,-247,-265,-282,-299,-316,-333,
  35.     -350,-366,-383,-400,-416,-432,-448,-464,-480,-496,
  36.     -511,-527,-542,-557,-572,-587,-601,-616,-630,-644,
  37.     -658,-671,-685,-698,-711,-724,-736,-748,-760,-772,
  38.     -784,-795,-806,-817,-828,-838,-848,-858,-868,-877,
  39.     -886,-895,-904,-912,-920,-928,-935,-942,-949,-955,
  40.     -962,-968,-973,-979,-984,-989,-993,-997,-1001,-1005,
  41.     -1008,-1011,-1014,-1016,-1018,-1020,-1021,-1022,-1023,-1023,
  42.     -1024,-1023,-1023,-1022,-1021,-1020,-1018,-1016,-1014,-1011,
  43.     -1008,-1005,-1001,-997,-993,-989,-984,-979,-973,-968,
  44.     -962,-955,-949,-942,-935,-928,-920,-912,-904,-895,
  45.     -886,-877,-868,-858,-848,-838,-828,-817,-806,-795,
  46.     -784,-772,-760,-748,-736,-724,-711,-698,-685,-671,
  47.     -658,-644,-630,-616,-601,-587,-572,-557,-542,-527,
  48.     -512,-496,-480,-464,-448,-432,-416,-400,-383,-366,
  49.     -350,-333,-316,-299,-282,-265,-247,-230,-212,-195,
  50.     -177,-160,-142,-124,-107,-89,-71,-53,-35,-17
  51. ]);
  52.  
  53.  
  54.  
  55. /*----------------------------------------------------------------------
  56.     fiexed sin
  57.         a:    angle(0-360)
  58. */
  59. DefConst('kFixedSin,
  60. func(a)
  61. begin
  62.     kSinTable[a mod 360];
  63. end);
  64.  
  65.  
  66. /*----------------------------------------------------------------------
  67.     fiexed cos
  68.         a:    angle(0-360)
  69. */
  70. DefConst('kFixedCos,
  71. func(a)
  72. begin
  73.     kSinTable[(a+90) mod 360];
  74. end);
  75.